package lambda.i;

import com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter;
import lambda.entity.User;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

/**
 * @author LIBOFEI
 * @ClassName Test
 * @description
 * @date 2021/8/23 16:49
 * @Version 1.0
 **/
public class Test  {

    private static Map<String, User> map1 = new HashMap<>();

    private static Map<String, User> map2 = new HashMap<>();

    private static List<User> userList = new ArrayList<>();

    public static List<User> getUserList(){
        User user1 = new User(1,"李博飞");
        User user2 = new User(2,"不达意");
        User user3 = new User(3,"帅哥1");
        userList.add(user1);
        userList.add(user2);
        userList.add(user3);
        return userList;
    }

    public static void main(String[] args) {
        User user1 = new User(1,"李博飞");
        User user2 = new User(2,"不达意");
        User user3 = new User(3,"帅哥1");
        map1.put(user1.getName(),user1);
        map1.put(user2.getName(),user2);
        map2.put(user3.getName(),user1);

        User user4 = new User(4,"不达意");
        map2.put(user4.getName(),user2);

        ceshi();


    }

    public static void ceshi(){
        Stream<User> userStream = getUserList().stream().map(t -> {
            t.setName("1111");
            return t;
        });
        System.out.println(userStream);
    }
}
